home *** CD-ROM | disk | FTP | other *** search
/ CICA 32 1998 April / CICA32 (April 1998) (Disc 4 of 4).iso / utils / unzip531.tgz / unzip531.tar / beos / beos.h < prev    next >
C/C++ Source or Header  |  1997-05-31  |  2KB  |  40 lines

  1. /* beos.h -- A few handy things for the BeOS port.     */
  2. /* (c) 1997 Chris Herborth (chrish@qnx.com)            */
  3. /* This is covered under the usual Info-ZIP copyright. */
  4.  
  5. #define EF_BE_ID        0x6542      /* 'Be' in little-endian form    */
  6. #define EF_BE_SIZE      5           /* at least unsigned long + flag */
  7.  
  8. #define EF_BE_FL_NATURAL    0x01    /* data is 'natural' (not compressed) */
  9. #define EF_BE_FL_BADBITS    0xfe    /* bits currently undefined           */
  10.  
  11. /*
  12. DR9 'Be' extra-field layout:
  13.  
  14. 'Be'      - signature
  15. ef_size   - size of data in this EF (little-endian unsigned short)
  16. full_size - uncompressed data size (little-endian unsigned long)
  17. flag      - flags (byte)
  18.             flags & EB_BE_FL_NATURAL    = the data is not compressed
  19.             flags & EB_BE_FL_BADBITS    = the data is corrupted or we
  20.                                           can't handle it properly
  21. data      - compressed or uncompressed file attribute data
  22.  
  23. If flag & EB_BE_FL_NATURAL, the data is not compressed; this optimisation is
  24. necessary to prevent wasted space for files with small attributes (which
  25. appears to be quite common on the Advanced Access DR9 release).  In this
  26. case, there should be ( ef_size - EB_L_BE_LEN ) bytes of data, and full_size
  27. should equal ( ef_size - EB_L_BE_LEN ).
  28.  
  29. If the data is compressed, there will be ( ef_size - EB_L_BE_LEN ) bytes of
  30. compressed data, and full_size bytes of uncompressed data.
  31.  
  32. If a file has absolutely no attributes, there will not be a 'Be' extra field.
  33.  
  34. The uncompressed data is arranged like this:
  35.  
  36. attr_name\0 - C string
  37. struct attr_info
  38. attr_data (length in attr_info.size)
  39. */
  40.